package com.example.hongyu.avtt.model;

import java.io.Serializable;

public class Permission implements Serializable {


    /**
     * 用户
     */
    public final static int TYPE_USER = 1;

    /**
     * 权限
     */
    public final static int TYPE_ROLE = 2;

    /**
     * 字典表
     */
    public final static int TYPE_DICTIONARY = 3;

    /**
     * 文章管理
     */
    public final static int TYPE_ARTICLE = 4;

    /**
     * 设备管理
     */
    public final static int TYPE_DEVICE = 5;

    /**
     * 设置管理
     */
    public final static int TYPE_SETTING = 6;

    /**
     * 环境分析
     */
    public final static int TYPE_ENV_ANALYSIS = 7;

    /**
     * 警报管理
     */
    public final static int TYPE_ALARM = 8;


    /**
     * 作物管理
     */
    public final static int TYPE_CROP = 9;



    /**
     * 作物日志管理
     */
    public final static int TYPE_JOURNAL = 10;


    /**
     * 常见问题管理
     */
    public final static int TYPE_FAQ = 11;


    /**
     * 系统管理
     */
    public final static int TYPE_SYS = 6;

    /**
     * 统计分析
     */
    public final static int TYPE_STATISTICS = 7;

    /**
     * 账号管理组
     */
    public final static int GROUP_TYPE_ACCOUNT = 1;

    /**
     * 功能模块管理组
     */
    public final static int GROUP_TYPE_FUNCTION = 2;

    /**
     * 其他
     */
    public final static int GROUP_TYPE_OTHER = 3;
    private static final long serialVersionUID = 2677239406657420585L;

    private int id;

    /**
     * 权限名称
     */
    private String name;

    /**
     * 值
     */
    private String value;

    /**
     * 权限分类
     */
    private int type;

    /**
     * 分组类型
     */
    private int groupType;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getGroupType() {
        return groupType;
    }

    public void setGroupType(int groupType) {
        this.groupType = groupType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Permission that = (Permission) o;

        if (id != that.id) return false;
        if (type != that.type) return false;
        if (groupType != that.groupType) return false;
        if (!name.equals(that.name)) return false;
        return value.equals(that.value);
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + name.hashCode();
        result = 31 * result + value.hashCode();
        result = 31 * result + type;
        result = 31 * result + groupType;
        return result;
    }
}
